package cn.raths.feign;

import cn.raths.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "userServer",fallbackFactory = UserFeignClientFallbackFactory.class)
public interface UserFeignClient {

    /*
        服务名要一致 ， url路径要一致 ， 参数要一致 ， 返回值类型要一致。
    */
    @GetMapping("/getById/{id}")
    User getUserById(@PathVariable("id") Long id);

}
